<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
<spring:url value="/fantasy-league/" var="league_url" />
<script>
$(function() {
	addSubMenuItem("${league.name}", "${league_url}${league.id}");
	addSubMenuItem("My Team", "#");
	addSubMenuItem("Players", "${league_url}${league.id}/players");
});
</script>
</head>
<body>



<h2><c:out value="${league.name}" /></h2>
	
	<table class="gridtable">
  	<thead>
  		<tr>
      		<th colspan="2">Teams</th>
   		</tr>
  		<tr>
  			<th>Team ID</th>
  			<th>Team Name</th>
  		</tr>
  	</thead>
  	<tbody>
		<c:forEach var="fantasyTeam" items="${league.fantasyTeams}">
			<tr>
	  		<td><c:out value="${fantasyTeam.id}" /></td>
	  		<td><a href="${league_url}${league.id}/${fantasyTeam.id}"><c:out value="${fantasyTeam.name}" /></a></td>
	  		</tr>
		</c:forEach>
	</tbody>
  	</table>

</body>
</html>